package com.dao;

import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
@Repository("indeximgDao")
public class IndeximgDao extends SqlMapClientDaoSupport {
	@Resource(name = "sqlMapClient")
	private SqlMapClient sqlMapClient;

	@PostConstruct
	public void initSqlMapClient() {
		super.setSqlMapClient(sqlMapClient);
	}
	
	
	/**
	 * ͨ����� ��ѯ ͼƬ
	 * @param paramStr
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public List searchIndeximg(Map pmap){
		 return super.getSqlMapClientTemplate().queryForList("searchIndeximg",pmap);
	}
	
	/**
	 * ͨ����� ��ѯ ͼƬ
	 * @param paramStr
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public int searchIndeximgCount(Map pmap){
		return Integer.parseInt( super.getSqlMapClientTemplate().queryForObject("searchIndeximgCount",pmap).toString());
	}
	
	/**
	 *  ���� ͼƬ
	 * @param paramStr
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public int addIndeximg(Map pmap){
		return super.getSqlMapClientTemplate().update("addIndeximg",pmap);
	}
	
	
	/**
	 *  ɾ�� ͼƬ
	 * @param paramStr
	 * @return
	 */
	public int deleteIndeximg(String id){
		return super.getSqlMapClientTemplate().update("deleteIndeximg",id);
	}
	/**
	 * ���� ͼƬ����
	 * @param paramStr
	 * @return
	 */
	public int updateIndeximgClounm(Map pmap){
		return super.getSqlMapClientTemplate().update("updateIndeximgClounm",pmap);
	}
	
	/**
	 * ͼƬ����
	 * @param paramStr
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public Map detailsIndeximg(String id){
		return (Map)super.getSqlMapClientTemplate().queryForObject("detailsIndeximg",id);
	}
	
	/**
	 * ���� ͼƬ 
	 * @param pmap
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public int updateIndeximg(Map pmap){
		return super.getSqlMapClientTemplate().update("updateIndeximg",pmap);
	}
	
	
	
	/**
	 * ͨ����� ��ѯ ͼƬ
	 * @param paramStr
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public List findIndeximg(String searchSql){
		 return super.getSqlMapClientTemplate().queryForList("findIndeximg",searchSql);
	}
	/**
	 * ͨ��˵�ID��ѯ����
	 * @param menuIdCount
	 * @return
	 */
	public int menuIdCount(String menuIdCount){
		return Integer.parseInt( super.getSqlMapClientTemplate().queryForObject("menuIdCount",menuIdCount).toString());			
	}
	
}
